public class Queue
{
	private int laenge;
	private float fArray[];
	
	public Queue(int laenge)
	{
		fArray = new float[laenge];
	}
	
	public void addItem(float item)
	{
		int l=0;
		
		while(l<fArray.length && fArray[l] != 0)
		{
			l++;
		}
		
		if (l<fArray.length)
		{
			fArray[l] = item;
		}
		else
		{
			System.out.println("Array voll! Leere Queue!");
		}
	}
	
	public float dequeue()
	{
		float temp;
		if(!isEmpty())
		{
			// return fArray[0];
			int l;
			temp = fArray[0];
			for(l=0;l<fArray.length-1;l++)
			{
				fArray[l] = fArray[l+1];
				fArray[l+1] = 0;
			}
			
			
			return temp;
				
		}
		else
			return -1;
	}
			
			
			
	public void queuePrint()
	{
		int l;
		for(l=0;l<fArray.length;l++)
		{
			System.out.println(fArray[l]+"\n");
		}
	
	}
	
	public boolean isEmpty()
	{
		if (fArray[0] == 0)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	
	public void clear()
	{
		int l;
		
		for(l=0;l<fArray.length;l++)
		{
			fArray[l] = 0;
		}
		System.out.println("Cleared\n");
		
	}
		
}

